From: Thomas Booker Date: Mon, 23 Jun 2025 06:13:08 +0000 (+1200) Subject: tools: Set XDG_DATA_DIRS inside toolbox run script X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~124^2^2~27 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=15a7371f924f1835c73fc836d13f264212f4f83a;p=gnome-shell.git tools: Set XDG_DATA_DIRS inside toolbox run script Some host OSes (like NixOS) have a weird $XDG_DATA_DIRS environment variable that gets inherited into the toolbox and brakes GSettings schemas. Address this by appending the default /usr/share to $XDG_DATA_DIRS if necessary. Part-of: --- diff --git a/tools/toolbox/run-gnome-shell.sh b/tools/toolbox/run-gnome-shell.sh index 23b1186b5..a74c41eb4 100755 --- a/tools/toolbox/run-gnome-shell.sh +++ b/tools/toolbox/run-gnome-shell.sh @@ -64,6 +64,13 @@ TOOLBOX=$DEFAULT_TOOLBOX SHELL_ENV=(XDG_CURRENT_DESKTOP=GNOME) SHELL_ARGS=() +# Some host OSes (like NixOS) have a weird $XDG_DATA_DIRS environment variable +# that breaks GSettings schemas. Make sure it is set to something sensible. +if [[ ! :$XDG_DATA_DIRS: =~ :/usr/share/?: ]] +then + SHELL_ENV+=(XDG_DATA_DIRS=$XDG_DATA_DIRS:/usr/share/) +fi + TEMP=$(getopt \ --name $(basename $0) \ --options '20t:vh' \